﻿<div class="modal" tabindex="-1" role="dialog" style="min-height:500px;">
    <div class="modal-dialog" role="document" style="width:70%">

        <div class="card">
            <div class="header">
                <button type="button" class="close" ng-click="$hide()">&times;</button>
                <h3 class="modal-title">{{title}}</h3>
            </div>
            <div activate-input class="body">
                <script type="text/ng-template" id="tree.html">
                    <li class="row" style="border-bottom:2px solid #f5f5f5; padding:8px 0px">

                    <span style="display:inline-block;">
                        <a href=""
                           class="glyphicon {{menu.isExpand ? 'glyphicon-chevron-down' : 'glyphicon-chevron-right'}}"
                           ng-click="loadChildMenu(menu)"></a>
                        <span class="ModulesSpan" style="cursor: pointer;" ng-click="loadChildMenu(menu)">{{menu.MenuName}}</span>
                    </span>

                    </li>
                    <div ng-hide="!menu.isExpand">
                        <div class="treeitem" ng-repeat="menu in menu.childMenus" ng-include="'tree.html'"
                             style="cursor: pointer;"></div>
                    </div>

                </script>
                <form class="form-horizontal" ng-submit="saveMenu()" role="form"
                      name="editMenuForm" ng-controller="filetypeMgrCtrl" novalidate>
                    <div class="row clearfix">
                        <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 form-control-label">
                            <label><span style="color:red">*</span>父级目录</label>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
                            <div class="form-group">
                                <div class="input-group" style="margin-bottom: 0px;">
                                    <div class="form-line"
                                         ng-class="{ 'focused error' : editMenuForm.ParentMenu.$invalid &&  editMenuForm.$submitted}">
                                        <input name="ParentMenu" type="text" ng-model="edit.menuParentName"
                                               class="form-control" ng-required="true" ng-disabled="true"/>
                                    </div>
                                    <span class="input-group-addon" ng-click="selectParent()">
                                            <i class="material-icons">search</i>
                                    </span>
                                </div>
                                <label ng-show="editMenuForm.ParentMenu.$invalid &&  editMenuForm.$submitted"
                                       class="error">必填.</label>

                            </div>
                        </div>
                        <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 form-control-label">
                            <label>排序</label>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
                            <div class="form-group">
                                <div class="form-line"
                                     ng-class="{ 'focused error' : editMenuForm.treelevel.$invalid &&  editMenuForm.$submitted}">
                                    <input name="treelevel" type="number" ng-model="menu.treelevel" class="form-control"
                                           ng-required="true" value={{menu.treelevel}}/>
                                </div>
                                <label ng-show="editMenuForm.treelevel.$invalid &&  editMenuForm.$submitted"
                                       class="error">必填.</label>
                            </div>
                        </div>
                    </div>
                    <div class="row clearfix">
                        <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 form-control-label">
                            <label>目录名称</label>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
                            <div class="form-group">
                                <div class="form-line"
                                     ng-class="{ 'focused error' : editMenuForm.filetypename.$invalid &&  editMenuForm.$submitted}">
                                    <input name="filetypename" type="text" ng-model="menu.filetypename" class="form-control"
                                           ng-required="true" value={{menu.filetypename}}
                                           ng-disabled="menu.filetypename=='菜单管理'"/>
                                </div>
                                <label ng-show="editMenuForm.filetypename.$invalid &&  editMenuForm.$submitted"
                                       class="error">必填.</label>
                            </div>
                        </div>
                    </div>
                    <div class="form_foot" style="text-align:center">
                        <button id="submit" class="btn btn-danger" style="padding:4px 20px 4px 20px" type="submit"
                                ng-disabled="editMenuForm.$invalid">提交
                        </button>
                        <button id="cancel" type="button" class="btn btn-default" style="padding:4px 20px 4px 20px"
                                ng-click="$hide()">取消
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
